#pragma once

typedef float (*vus_interpolator)(float min, float max, float amount);

typedef struct _vus_keyframe vus_keyframe;
typedef struct _vus_keyframe_range vus_keyframe_range;
typedef struct _vus_keyframe_list vus_keyframe_list;
typedef struct _vus_keyframed_property vus_keyframed_property;

/**
 * Creates a new keyframed property object.
 *
 * @return A keyframed property object.
 */
VENTUS_EXPORT vus_keyframed_property *vus_keyframed_property_alloc();

/**
 * Deletes a keyframed property object.
 *
 * @param self The keyframed property.
 */
VENTUS_EXPORT void vus_keyframed_property_free(vus_keyframed_property *self);

/**
 * Gets the interpolator used by a keyframed property.
 *
 * @param self The keyframed property.
 * @return A non-null interpolator function object.
 */
VENTUS_EXPORT vus_interpolator vus_keyframed_property_get_interpolator(vus_keyframed_property *self);

/**
 * Sets the interpolator used by a keyframed property.
 *
 * @param self The keyframed property.
 * @param value The interpolator.
 */
VENTUS_EXPORT void vus_keyframed_property_set_interpolator(vus_keyframed_property *self, vus_interpolator value);

/**
 * Gets the range of keyframe values allowed by a keyframed property.
 *
 * @param self The keyframed property.
 * @return A valid keyframe range.
 */
VENTUS_EXPORT vus_keyframe_range vus_keyframed_property_get_range(vus_keyframed_property *self);

/**
 * Sets the range of keyframe values allowed by a keyframed property.
 *
 * @param self The keyframed property.
 * @param value The new range.
 */
VENTUS_EXPORT void vus_keyframed_property_set_range(vus_keyframed_property *self, vus_keyframe_range value);

/**
 * Gets the list of keyframes owned by a keyframed property.
 *
 * @param self the keyframed property.
 * @return A non-null keyframe list.
 */
VENTUS_EXPORT vus_keyframe_list *vus_keyframed_property_keyframes(vus_keyframed_property *self);

/**
 * Gets the value of a keyframed property at a given frame.
 *
 * @param self The keyframed property.
 * @param frame The frame at which to retrieve the value.
 * @return The resulting value.
 */
VENTUS_EXPORT float vus_keyframed_property_value(vus_keyframed_property *self, long frame);
